#
#
#
#
#

CC=arm-linux-gcc#
LD=arm-linux-ld#
AR=arm-linux-ar#
LDFLAGS=-g
ARFLAGS=-r
CFLAGS=-I ../../srl_include -I ../../srl_include/comm -I ../../srl_include/drv -I ../../srl_include/head -I ../../srl_include/int -I ../../srl_include/kernel

vpath %.h ../../srl_include
vpath %.h ../../srl_include/comm
vpath %.h ../../srl_include/drv
vpath %.h ../../srl_include/head
vpath %.h ../../srl_include/int
vpath %.h ../../srl_include/kernel

CP15_TAG=k_cp15.a# use static library
CP15_OBJ=cp15.o
CP15_SRC=$(CP15_OBJ:.o=.c)
CP15_DEP=$(CP15_OBJ:.o=.d)

$(CP15_TAG):$(CP15_OBJ) $(CP15_DEP)
	$(AR) $(ARFLAGS) $@ $(CP15_OBJ)

dep:$(CP15_DEP)
$(CP15_DEP):%.d:%.c
	rm -f $*.d;\
	gcc $(CFLAGS) -MM $<|sed 's,^.*:,$*.o:,' >log.$$$$1;\
	echo $(CC) $(CFLAGS) -c $< -o $*.o >log.$$$$2;\
	cat log.$$$$1 log.$$$$2|sed 's/^$(CC)/\t$(CC)/g' >$@;\
	rm -f log.$$$$*;\

include $(CP15_OBJ:.o=.d)

clean:
	rm -f $(CP15_DEP) $(CP15_OBJ) $(CP15_TAG)
